/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tk.eigh.ksvg.component.filter;

import java.util.List;
import ksvg.core.SVGFilter;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
import tk.eigh.ksvg.types.SVGNumber;

/**
 *
 * @author nt
 */
@JSFComponent(name = "svg:ConvolveMatrix",
type = "tk.eigh.svg.ConvolveMatrix",
family = "filter.ConvolveMatrix",
clazz = "ksvg.filter.ConvolveMatrix",
tagClass = "ksvg.tags.filter.ConvolveMatrixTag",
defaultRendererType = "filter.SVGConvolveMatrixRenderer",
desc = "see <a href=\"http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElement\">Scalable Vector Graphics (SVG) 1.1 (Second Edition)</a>")
public abstract class AbstractConvolveMatrix extends SVGFilter {

    /**
     * order = "<number-optional-number>"<br/> Indicates the number of cells in
     * each dimension for ‘kernelMatrix’. The values provided must be <integer>s
     * greater than zero. The first number, <orderX>, indicates the number of
     * columns in the matrix. The second number, <orderY>, indicates the number
     * of rows in the matrix. If <orderY> is not provided, it defaults to
     * <orderX>. A typical value is order="3". It is recommended that only small
     * values (e.g., 3) be used; higher values may result in very high CPU
     * overhead and usually do not produce results that justify the impact on
     * performance. If the attribute is not specified, the effect is as if a
     * value of 3 were specified.<br/> Animatable: yes.
     */
    @JSFProperty
    public abstract String getOrder();

    /**
     * kernelMatrix = "<list of numbers>"<br/> The list of <number>s that make
     * up the kernel matrix for the convolution. Values are separated by space
     * characters and/or a comma. The number of entries in the list must equal
     * <orderX> times <orderY>.<br/> Animatable: yes.
     */
    @JSFProperty
    public abstract List<SVGNumber> getKernelMatrix();

    /**
     * divisor = "<number>"<br/> After applying the ‘kernelMatrix’ to the input
     * image to yield a number, that number is divided by ‘divisor’ to yield the
     * final destination color value. A divisor that is the sum of all the
     * matrix values tends to have an evening effect on the overall color
     * intensity of the result. It is an error to specify a divisor of zero. The
     * default value is the sum of all values in kernelMatrix, with the
     * exception that if the sum is zero, then the divisor is set to 1.<br/>
     * Animatable: yes.
     */
    @JSFProperty
    public abstract SVGNumber getDivisor();

    /**
     * bias = "<number>"<br/> After applying the ‘kernelMatrix’ to the input
     * image to yield a number and applying the ‘divisor’, the ‘bias’ attribute
     * is added to each component. One application of ‘bias’ is when it is
     * desirable to have .5 gray value be the zero response of the filter. The
     * bias property shifts the range of the filter. This allows representation
     * of values that would otherwise be clamped to 0 or 1. If ‘bias’ is not
     * specified, then the effect is as if a value of 0 were specified.<br/>
     * Animatable: yes.
     */
    @JSFProperty
    public abstract SVGNumber getBias();

    /**
     * targetX = "<integer>"<br/> Determines the positioning in X of the
     * convolution matrix relative to a given target pixel in the input image.
     * The leftmost column of the matrix is column number zero. The value must
     * be such that: 0 &lt;= targetX &lt; orderX. By default, the convolution
     * matrix is centered in X over each pixel of the input image (i.e., targetX
     * = floor ( orderX / 2 )).<br/> Animatable: yes.
     */
    @JSFProperty
    public abstract Integer getTargetX();

    /**
     * targetY = "<integer>"<br/> Determines the positioning in Y of the
     * convolution matrix relative to a given target pixel in the input image.
     * The topmost row of the matrix is row number zero. The value must be such
     * that: 0 &lt;= targetY &lt; orderY. By default, the convolution matrix is
     * centered in Y over each pixel of the input image (i.e., targetY = floor (
     * orderY / 2 )).<br/> Animatable: yes.
     */
    @JSFProperty
    public abstract Integer getTargetY();

    /**
     * edgeMode = "duplicate | wrap | none"<br/><p>Determines how to extend the
     * input image as necessary with color values so that the matrix operations
     * can be applied when the kernel is positioned at or near the edge of the
     * input image.</p> <p>"duplicate" indicates that the input image is
     * extended along each of its borders as necessary by duplicating the color
     * values at the given edge of the input image.</p>
     * <pre>
     * Original N-by-M image, where m=M-1 and n=N-1:
     * 11 12 ... 1m 1M
     * 21 22 ... 2m 2M
     * .. .. ... .. ..
     * n1 n2 ... nm nM
     * N1 N2 ... Nm NM
     * Extended by two pixels using "duplicate":
     * 11 11   11 12 ... 1m 1M   1M 1M
     * 11 11   11 12 ... 1m 1M   1M 1M
     * 11 11   11 12 ... 1m 1M   1M 1M
     * 21 21   21 22 ... 2m 2M   2M 2M
     * .. ..   .. .. ... .. ..   .. ..
     * n1 n1   n1 n2 ... nm nM   nM nM
     * N1 N1   N1 N2 ... Nm NM   NM NM
     * N1 N1   N1 N2 ... Nm NM   NM NM
     * N1 N1   N1 N2 ... Nm NM   NM NM
     * </pre> <p>"wrap" indicates that the input image is extended by taking the
     * color values from the opposite edge of the image.</p>
     * <pre>
     * Extended by two pixels using "wrap":
     * nm nM   n1 n2 ... nm nM   n1 n2
     * Nm NM   N1 N2 ... Nm NM   N1 N2
     * 1m 1M   11 12 ... 1m 1M   11 12
     * 2m 2M   21 22 ... 2m 2M   21 22
     * .. ..   .. .. ... .. ..   .. ..
     * nm nM   n1 n2 ... nm nM   n1 n2
     * Nm NM   N1 N2 ... Nm NM   N1 N2
     * 1m 1M   11 12 ... 1m 1M   11 12
     * 2m 2M   21 22 ... 2m 2M   21 22
     * </pre> <p>"none" indicates that the input image is extended with pixel
     * values of zero for R, G, B and A.</p> <p> If attribute <a
     * href="filters.html#feConvolveMatrixElementEdgeModeAttribute">‘edgeMode’</a>
     * is not specified, then the effect is as if a value of duplicate were
     * specified. </p><br/>Animatable: yes.
     */
    @JSFProperty
    public abstract String getEdgeMode();

    /**
     * <a id="feConvolveMatrixElementKernelUnitLengthAttribute"
     * name="feConvolveMatrixElementKernelUnitLengthAttribute"/>kernelUnitLength
     * = "<a
     * href="http://www.w3.org/TR/SVG/types.html#DataTypeNumberOptionalNumber">&lt;number-optional-number&gt;</a>"<br/>The
     * first number is the &lt;dx&gt; value. The second number is the &lt;dy&gt;
     * value. If the &lt;dy&gt; value is not specified, it defaults to the same
     * value as &lt;dx&gt;. Indicates the intended distance in current filter
     * units (i.e., units as determined by the value of attribute <a
     * href="http://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute">‘primitiveUnits’</a>)
     * between successive columns and rows, respectively, in the <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementKernelMatrixAttribute">‘kernelMatrix’</a>.
     * By specifying value(s) for <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementKernelUnitLengthAttribute">‘kernelUnitLength’</a>,
     * the kernel becomes defined in a scalable, abstract coordinate system. If
     * <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementKernelUnitLengthAttribute">‘kernelUnitLength’></a>
     * is not specified, the default value is one pixel in the offscreen bitmap,
     * which is a pixel-based coordinate system, and thus potentially not
     * scalable. For some level of consistency across display media and user
     * agents, it is necessary that a value be provided for at least one of <a
     * href="http://www.w3.org/TR/SVG/filters.html#FilterElementFilterResAttribute">‘filterRes’</a>
     * and <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementKernelUnitLengthAttribute">‘kernelUnitLength’></a>.
     * In some implementations, the most consistent results and the fastest
     * performance will be achieved if the pixel grid of the temporary offscreen
     * images aligns with the pixel grid of the kernel.<br/> A negative or zero
     * value is an error).<br/><a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract String getKernelUnitLength();

    /**
     * preserveAlpha = "false | true"<br/>A value of false indicates that the
     * convolution will apply to all channels, including the alpha channel. In
     * this case the
     * <code>ALPHA<sub>X,Y</sub></code> of the <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementFormula">convolution
     * formula</a> for a given pixel is:
     *
     * <p> ALPHA<sub>X,Y</sub> = ( <br/>               SUM <sub>I=0 to [<a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementOrderAttribute">orderY</a>-1]</sub> { <br/>
     *                 SUM <sub>J=0 to [<a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementOrderAttribute">orderX</a>-1]</sub> { <br/>
     *                   SOURCE <sub>X-<a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementTargetXAttribute">targetX</a>+J, Y-<a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementTargetYAttribute">targetY</a>+I</sub> * 
     * <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementKernelMatrixAttribute">
     * kernelMatrix</a><sub><a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementOrderAttribute">orderX</a>-J-1, 
     * <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementOrderAttribute">orderY</a>-I-1</sub> <br/>
     *                 } <br/>               } <br/>             ) /  <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementDivisorAttribute">divisor</a> + 
     * <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementBiasAttribute">bias</a> 
     * <br/> </p>
     *
     * <br/> A value of true indicates that the convolution will only apply to
     * the color channels. In this case, the filter will temporarily
     * unpremultiply the color component values, apply the kernel, and then
     * re-premultiply at the end. In this case the
     * <code>ALPHA<sub>X,Y</sub></code> of the <a
     * href="http://www.w3.org/TR/SVG/#feConvolveMatrixElementFormula">convolution
     * formula</a> for a given pixel is: <p class="filterformula">
     * ALPHA<sub>X,Y</sub> = SOURCE<sub>X,Y</sub> <br/> </p> If <a
     * href="http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElementPreserveAlphaAttribute">‘preserveAlpha’</a>
     * is not specified, then the effect is as if a value of false were
     * specified.<br/> <a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract Boolean getPreserveAlpha();
}